﻿using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Masuit.Tools;
using Masuit.Tools.DateTimeExt;

namespace furion.blog.Domain
{
    public class MongoBaseModel : Entity
    {
        /// <summary>
        /// 创建时间
        /// </summary>
        [Field(fieldName: "created_time")]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime CreatedTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 创建时间戳(用于分页)
        /// </summary>
        [Field(fieldName: "ts")]
        public long Ts { get; set; } = DateTime.Now.GetTotalNanoseconds();
    }
}
